<template lang="pug">
  s-table(
    ref="table"
    :column="tableObj.column"
    :filterProps="{items: tableObj.filterItems}"
    :queryFn="tableObj.getList"
    rowKey="taskId"
    title="数据统计列表"
    )
    .table-operator(slot="table-operator")
      el-radio-group(v-model="tableType")
        el-radio-button(label="1") 医疗机构在床率统计
        el-radio-button(label="2") 查床明细数据统计
</template>
<script>
import { STable } from '@/components'
import { taskList } from '@/api/remote'

const column = [
  {
    prop: 'sort',
    label: '序号'
  },
  {
    prop: 'taskDscr',
    label: '医疗机构名称'
  },
  {
    prop: 'medinsName',
    label: '查房次数',
    align: 'center'
  },
  {
    prop: 'taskWay',
    label: '抽查人数',
    align: 'center'
  },
  {
    prop: 'taskStas',
    label: '完成人数',
    align: 'center'
  },
  {
    prop: 'chkProp',
    label: '审核通过人数',
    align: 'center'
  },
  {
    prop: 'crteTime',
    label: '在床率',
    align: 'center'
  },
  {
    prop: 'taskBegntime',
    label: '二次下发人数',
    align: 'center'
  },
  {
    prop: 'taskEndtime',
    label: '二次下发率',
    align: 'center'
  }
]

export default {
  name: 'RemoteStaticsList',
  components: {
    STable
  },
  data () {
    return {
      tableType: 1,
      tableObj: {
        column,
        getList: taskList,
        filterItems: [
          {
            key: 'medinsId',
            label: '关键信息',
            type: 'selectdict',
            dictKey: 'medinsIds'
          },
          {
            key: 'admdvs',
            label: '医保区',
            type: 'selectdict',
            dictKey: 'admdvs'
          },
          {
            key: 'Date',
            label: '添加日期',
            type: 'daterange'
          }
        ]
      }
    }
  },
  watch: {
    tableType () {
      this.refreshTable(true)
    }
  },
  created () {
  },
  methods: {
    // 刷新表格
    refreshTable (flag = false) {
      this.$refs.table.refresh(flag)
    }
  }
}
</script>
